/**
 * @Author: 健聪
 * @Description: 方法定义
 * @Date: 2024/1/12
 */
void main(List args) {
  print(args);
  print(getPerson("张三", 18));
  printPerson("李四", 20);

  print(printPerson("王五", 22));   // 当没有指定要有返回值时，返回null
}

// String getPerson(String name, int age) {
//   return "name: $name, age: $age";
// }

// 箭头函数写法
// getPerson(name, age) => "name: $name, age: $age";
int gender = 2;
getPerson(name, age) => gender == 1 ? "name: $name, age: $age" : "Test";

// void printPerson(String name, int age) {
//   print("name: $name, age: $age");
// }

printPerson(String name, int age) {
  print("name: $name, age: $age");
}